<!doctype html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=0, minimum-scale=1.0, maximum-scale=1.0">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<meta name="apple-touch-fullscreen" content="yes" />
<!-- <meta http-equiv="refresh" content="3" /> -->
<title></title>
<style type="text/css">
.ifr {
	display:none;
}
</style>
<script type="text/javascript" src="javascript/jquery-1.8.3.min.js"></script>
<script type="text/javascript">
$(document).ready(function() {
	var log = function (msg) {
	    $('body').before('<div class="log">' + msg + '</div>');
	};
	var timeout, t = 1000, hasApp = true;
	// 与启动时差2秒
	setTimeout(function () {
	    if (hasApp) {
	        log('安装了app');
	        $('#dl_app').hide();
	    } else {
	        log('未安装app');
	        $('#dl_app').show();
	        log('开始强制下载');
	       // forceDownload();
	    }
	}, 5000); // 2000
	function testApp() {
	    var t1 = Date.now();
	    var ifr = $('<iframe id="ifr" class="ifr"></iframe>')
	    ifr.attr('src', 'xiaozhangyu://www.htwater.net:8080/hisweb?age=2&name=cnnb');
	    $('body').append(ifr);
	    timeout = setTimeout(function () {
	        try_to_open_app(t1);
	    }, t);
	}
	function try_to_open_app(t1) {
	    var t2 = Date.now();
	    if (!t1 || t2 - t1 < t + 200) {
	        hasApp = false;
	    }
	}
	setTimeout(testApp, 3000);
	// testApp();
});

</script>
</head>
<body>
<h1>Start App </h1>
<!-- <a href="myapp://jp.app/openwith?name=zhangsan&age=26">启动应用程序</a> --> 
<div id>
<a href="xiaozhangyu://www.htwater.net:8080/hisweb?age=2&name=cnnb">启动应用程序1</a><p>
<a href="http://www.htwater.net:8080/hisweb?age=2&name=cnnb">启动应用程序2</a><p>
<a href="market://search?q=pname:com.nytimes.android">search marcket!</a>
</body>
</html>